package com.kunpu.mami.channel.common;

/** 
 * @ClassName: BankErrorEnum 
 * @Description:  银行错误码
 * @author  wangtq 
 * @date 2016年10月10日 上午11:00
 *  
 */
public enum BankErrorEnum {
	
   //1开头的为参数验证错误,2开头的为业务逻辑校验错误，9开头的为系统错误

	S0000("0000","交易成功"),																																						
	BF00100("BF00100",	"系统异常，请联系宝付                                   "	),																																							
	BF00101("BF00101",	"持卡人信息有误                                         "	),																																							
	BF00102("BF00102",	"银行卡已过有效期，请联系发卡行                         "	),																																							
	BF00103("BF00103",	"账户余额不足                                           "	),																																							
	BF00104("BF00104",	"交易金额超限                                           "	),																																							
	BF00105("BF00105",	"短信验证码错误                                         "	),																																							
	BF00106("BF00106",	"短信验证码失效                                         "	),																																							
	BF00107("BF00107",	"当前银行卡不支持该业务，请联系发卡行                   "	),																																							
	BF00108("BF00108",	"交易失败，请联系发卡行                                 "	),																																							
	BF00109("BF00109",	"交易金额低于限额                                       "	),																																							
	BF00110("BF00110",	"该卡暂不支持此交易                                     "	),																																							
	BF00111("BF00111",	"交易失败                                               "	),																																							
	BF00112("BF00112",	"系统繁忙，请稍后再试                                   "	),																																							
	BF00113("BF00113",	"交易结果未知，请稍后查询                               "	),																																							
	BF00114("BF00114",	"订单已支付成功，请勿重复支付                           "	),																																							
	BF00115("BF00115",	"交易处理中，请稍后查询                                 "	),																																							
	BF00116("BF00116",	"该终端号不存在                                         "	),																																							
	BF00117("BF00117",	"交易金额超限，请联系宝付                               "	),																																							
	BF00118("BF00118",	"报文中密文解析失败                                     "	),																																							
	BF00119("BF00119",	"短信验证超时，请稍后再试                               "	),																																							
	BF00120("BF00120",	"报文交易要素缺失                                       "	),																																							
	BF00121("BF00121",	"报文交易要素格式错误                                   "	),																																							
	BF00122("BF00122",	"卡号和支付通道不匹配                                   "	),																																							
	BF00123("BF00123",	"商户不存在或状态不正常，请联系宝付                     "	),																																							
	BF00124("BF00124",	"商户与终端号不匹配                                     "	),																																							
	BF00125("BF00125",	"商户该终端下未开通此类型交易                           "	),																																							
	BF00126("BF00126",	"该笔订单已存在                                         "	),																																							
	BF00127("BF00127",	"不支持该支付通道的交易                                 "	),																																							
	BF00128("BF00128",	"该笔订单不存在                                         "	),																																							
	BF00129("BF00129",	"密文和明文中参数【%s】不一致,请确认是否被篡改！        "	),																																							
	BF00130("BF00130",	"请确认是否发送短信,当前交易必须通过短信验证！          "	),																																							
	BF00131("BF00131",	"当前交易信息与短信交易信息不一致,请核对信息            "	),																																							
	BF00132("BF00132",	"短信验证超时，请稍后再试                               "	),																																							
	BF00133("BF00133",	"短信验证失败                                           "	),																																							
	BF00134("BF00134",	"绑定关系不存在                                         "	),																																							
	BF00135("BF00135",	"交易金额不正确                                         "	),																																							
	BF00136("BF00136",	"订单创建失败                                           "	),																																							
	BF00137("BF00137",	"个人会员不能为空                                       "	),																																							
	BF00138("BF00138",	"个人会员不存在                                         "	),																																							
	BF00140("BF00140",	"该卡已被注销                                           "	),																																							
	BF00141("BF00141",	"该卡已挂失                                             "	),																																							
	BF00142("BF00142",	"暂不支持该银行卡的绑卡                                 "	),																																							
	BF00143("BF00143",	"绑卡失败                                               "	),																																							
	BF00144("BF00144",	"该交易有风险,订单处理中                                "	),																																							
	BF00146("BF00146",	"订单金额超过单笔限额                                   "	),																																							
	BF00147("BF00147",	"该银行卡不支持此交易                                   "	),																																							
	BF00177("BF00177",	"非法的交易                                             "	),																																							
	BF00180("BF00180",	"获取短信验证码失败                                     "	),																																							
	BF00182("BF00182",	"您输入的银行卡号有误，请重新输入                       "	),																																							
	BF00186("BF00186",	"该卡已绑定                                             "	),																																							
	BF00187("BF00187",	"暂不支持信用卡的绑定                                   "	),																																							
	BF00188("BF00188",	"绑卡失败                                               "	),																																							
	BF00189("BF00189",	"交易金额超过限额                                       "	),																																							
	BF00190("BF00190",	"商户流水号不能重复                                     "	),																																							
	BF00191("BF00191",	"绑定id和用户id不匹配                                   "	),																																							
	BF00192("BF00192",	"标的开始日期格式不正确                                 "	),																																							
	BF00193("BF00193",	"标的结束日期格式不正确                                 "	),																																							
	BF00194("BF00194",	"标的到期还款日期格式不正确                             "	),																																							
	BF00195("BF00195",	"交易金额不正确                                         "	),																																							
	BF00196("BF00196",	"标的金额不正确                                         "	),																																							
	BF00197("BF00197",	"还款总金额不正确                                       "	),																																							
	BF00198("BF00198",	"年化率格式不正确                                       "	),																																							
	BF00199("BF00199",	"订单日期格式不正确                                     "	),																																							
	BF00200("BF00200",	"发送短信和支付时商户订单号不一致                       "	),																																							
	BF00201("BF00201",	"发送短信和支付交易时金额不相等                         "	),																																							
	BF00202("BF00202",	"交易超时，请稍后查询                                   "	),																																							
	BF00203("BF00203",	"退款交易已受理                                         "	),																																							
	BF00204("BF00204",	"确认绑卡时与预绑卡时的商户订单号不一致                 "	),																																							
	BF00232("BF00232",	"银行卡未开通认证支付                                   "	),																																							
	BF00233("BF00233",	"密码输入次数超限，请联系发卡行                         "	),																																							
	BF00234("BF00234",	"单日交易金额超限                                       "	),																																							
	BF00235("BF00235",	"单笔交易金额超限                                       "	),																																							
	BF00236("BF00236",	"卡号无效，请确认后输入                                 "	),																																							
	BF00237("BF00237",	"该卡已冻结，请联系发卡行                               "	),																																							
	BF00238("BF00238",	"交易结果未知，请稍后查询                               "	),																																							
	BF00248("BF00248",	"单笔交易金额超限                                       "	),																																							
	BF00249("BF00249",	"订单已过期，请使用新的订单号发起交易                   "	),																																							
	BF00251("BF00251",	"订单未支付                                             "	),																																							
	BF00253("BF00253",	"交易拒绝                                               "	),																																							
	BF00254("BF00254",	"交易处理中                                             "	),																																							
	BF00255("BF00255",	"发送短信验证码失败                                     "	),																																							
	BF00256("BF00256",	"请重新获取验证码                                       "	),																																							
	BF00257("BF00257",	"短信验证码校验失败                                     "	),																																							
	BF00258("BF00258",	"手机号码校验失败                                       "	),																																							
	BF00259("BF00259",	"短信验证码已失效                                       "	),																																							
	BF00260("BF00260",	"短信验证码已过期，请重新发送                           "	),																																							
	BF00261("BF00261",	"短信验证码错误次数超限，请重新获取                     "	),																																							
	BF00262("BF00262",	"交易金额与扣款成功金额不一致，请联系宝付               "	),																																							
	BF00301("BF00301",	"商户号和终端号与原订单不匹配                           "	),																																							
	BF00309("BF00309",	"绑卡和发送短信时手机号不一致                           "	),																																							
	BF00311("BF00311",	"卡类型和biz_type值不匹配                               "	),																																							
	BF00312("BF00312",	"交易金额不匹配                                         "	),																																							
	BF00313("BF00313",	"商户请求IP：【%s】不合法                               "	),																																							
	BF00315("BF00315",	"手机号码为空，请重新输入                               "	),																																							
	BF00316("BF00316",	"ip未绑定，请联系宝付                                   "	),																																							
	BF00317("BF00317",	"短信验证码已失效，请重新获取                           "	),																																							
	BF00320("BF00320",	"卡bin找不到目前已支持的银行                            "	),																																							
	BF00321("BF00321",	"身份证号不合法                                         "	),																																							
	BF00322("BF00322",	"卡类型和卡号不匹配                                     "	),																																							
	BF00323("BF00323",	"商户未开通交易模版                                     "	),																																							
	BF00324("BF00324",	"暂不支持此银行卡支付，请更换其他银行卡或咨询商户客服   "	),																																							
	BF00325("BF00325",	"非常抱歉！目前该银行正在维护中，请更换其他银行卡支付   "	),																																							
	BF08701("BF08701",	"该卡本次可支付***元，请更换其他银行卡！                "	),																																							
	BF08702("BF08702",	"该商户本次可支付***元，请更换其他银行卡或咨询商户客服！"	),;																																						

    private String code;

    private String msg;

    BankErrorEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static BankErrorEnum geteEnumByCode(String code) {
        for (BankErrorEnum value : BankErrorEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
    public static String geteMsgByCode(String code) {
        for (BankErrorEnum value : BankErrorEnum.values()) {
            if (value.code.equals(code)) {
                return value.getMsg();
            }
        }
        return null;
    }
    
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean equals(String code) {
        return getCode().equals(code);
    }
}
